// 节流
export function debounce(fn, wait=0){
  let timer;
  return function(){
    const args = arguments;
    if(timer){
      clearTimeout(timer)
    }
    timer = setTimeout(() => {
      timer = null;
      fn.apply(this, args)
    }, wait);
  }
}
